// 导入路由
import { createBrowserRouter } from "react-router-dom";
import App from "./App";
import ErrorPage from "./routes/error-page";

import DateToConputer from './page/DateToConputer/DateToConputer'
import { Home } from "./page/home/Home";
import { MobxTestCom } from "./page/mobxtest/mobxtest";
import { ImageMore } from "./page/ImageMore/ImageMore";
import AnimationCss from "./page/AnimationCss/AnimationCss";
import Register from "./page/register/Register";
import Amap from "./page/amap/AmapCom";

interface RoutesType{
  name?:string;
  path:string;
  children?:Array<RoutesType>;
  element:any;
  errorElement?:any;
}
const routes:Array<RoutesType> =[
  {
    path: "/",
    element: <App></App>,
    errorElement: <ErrorPage></ErrorPage>,
    children: [
      {
        path: "/",
        element: <Home value={'主页'} title={'主页'} />,
      },
      {
        path: "DateToConputer",
        element: <DateToConputer />,
      },
      {
        path:"mobxdemo",
        element:<MobxTestCom title="mobx示例" />
      },
      {
        path:"imageMore",
        element:<ImageMore />
      },
      {
        path:"AnimationCss",
        element:<AnimationCss />
      },
      {
        path:"Register",
        element:<Register />
      }
      ,
      {
        path:"amap",
        element:<Amap />
      }
    ],
  },
]

export const router = createBrowserRouter(routes);